package com.baizhi.luoht.controller;/**
 * @Author:luoht
 * @Description：
 * @Date：Create in 11:23 2018/10/24
 */

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

/**
 * @program: SpringMVC
 * @description:
 * @author: luoht
 * @create: 2018-10-24 11:23
 **/


@Controller
@RequestMapping("/scope")
@SessionAttributes(value = {"name"})
public class ScopeController {


    @RequestMapping("/session")
    public String method3(ModelMap model){
        model.addAttribute("name","Sediment123");
        return "c2jTarget";
    }

    @RequestMapping("/forward")
    public String method1(ModelMap model){
        model.addAttribute("username","Adrien123");
        return "forward:/c2jTarget.jsp";
    }




    @RequestMapping("/redirect")
    public String method2(){
        System.out.println("==============c2j================");
        return "redirect:/c2jTarget.jsp";
    }



}
